/******************
  *pids borad, record the process status
  *
  *created by dirkcai
  ****************/
#ifndef PIDSBOARDMANAGER_H
#define PIDSBOARDMANAGER_H

#include "shmmanager.h"

enum eProcState
{
	eEmpty,
	eFree,
	eBusy
};

struct PidBoard
{
	pid_t pid;//-1:
   	eProcState state;//-1:not be forked 0:free 1:busy 	
};

class PidsBoadManager
{
public:
	PidsBoadManager( int key, int iPidsCount );
	~PidsBoadManager();
	int Init();
	int Destory();
	int New( int pid );
	int SetState( int pid, eProcState eState );
	bool CheckState( eProcState eState, int &pid);

private:
	int m_iPidsCount;
	ShmManager * m_ptShmManager;	
};

#endif
